home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / cprod1d.z / cprod1d
Encoding:
Text File  |  1998-10-30  |  6.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccpppprrrroooodddd1111dddd,,,,zzzzpppprrrroooodddd1111dddd((((3333FFFF))))                                        ccccpppprrrroooodddd1111dddd,,,,zzzzpppprrrroooodddd1111dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccpppprrrroooodddd1111dddd,,,, zzzzpppprrrroooodddd1111dddd ---- Compute the product of a 1D Fourier transform with a
  10.      1D filter.
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  13.      _F_o_r_t_r_a_n :
  14.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccpppprrrroooodddd1111dddd(((( nnnn,,,,aaaarrrrrrrraaaayyyy,,,,iiiinnnnccccaaaa,,,,ffffiiiilllltttteeeerrrr,,,,iiiinnnnccccffff))))
  15.           iiiinnnntttteeeeggggeeeerrrr   nnnn,,,, iiiinnnnccccaaaa,,,, iiiinnnnccccffff
  16.           ccccoooommmmpppplllleeeexxxx   aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnnccccaaaa)))),,,, ffffiiiilllltttteeeerrrr((((0000::::((((nnnn----1111))))****iiiinnnnccccffff))))
  17.  
  18.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzpppprrrroooodddd1111dddd(((( nnnn,,,,pppp,,,,aaaarrrrrrrraaaayyyy,,,,iiiinnnnccccaaaa,,,,ffffiiiilllltttteeeerrrr,,,,iiiinnnnccccffff))))
  19.           iiiinnnntttteeeeggggeeeerrrr   nnnn,,,, iiiinnnnccccaaaa,,,, iiiinnnnccccffff
  20.           ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx      aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnnccccaaaa)))),,,,
  21.                              ffffiiiilllltttteeeerrrr((((0000::::((((nnnn----1111))))****iiiinnnnccccffff))))
  22.  
  23.  
  24.      _C :
  25.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  26.      iiiinnnntttt ccccpppprrrroooodddd1111dddd((((iiiinnnntttt nnnn,,,, ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnncccc,,,,
  27.                ccccoooommmmpppplllleeeexxxx ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt iiiinnnnccccffff))));;;;
  28.      iiiinnnntttt zzzzpppprrrroooodddd1111dddd((((iiiinnnntttt nnnn,,,, zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt iiiinnnncccc,,,,
  29.                zzzzoooommmmpppplllleeeexxxx ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt iiiinnnnccccffff))));;;;
  30.  
  31.  
  32. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  33.      ccccpppprrrroooodddd1111dddd and zzzzpppprrrroooodddd1111dddd compute the product of the Fourier transforms of a
  34.      complex sequence of N samples with the Fourier transforms of a complex
  35.      filter.
  36.      Note, the product of the Fourier transforms of two sequences is equal to
  37.      the Fourier transform of their convolution.
  38.  
  39.  
  40. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  41.      NNNN ---- Integer, the number of samples in each sequence.
  42.      Unchanged on exit.
  43.  
  44.      AAAARRRRRRRRAAAAYYYY ---- Array containing the Fourier Transform.  On exit, the array is
  45.      overwritten by the product.
  46.  
  47.      IIIINNNNCCCCAAAA ---- Integer, increment between two consecutive elements of the
  48.      sequence.  Unchanged on exit.
  49.  
  50.      FFFFIIIILLLLTTTTEEEERRRR ---- Array containing the Fourier Transform of the filter.  Unchanged
  51.      on exit.
  52.  
  53.      IIIINNNNCCCCFFFF ---- Integer, increment between two consecutive elements of the filter.
  54.      Unchanged on exit.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccpppprrrroooodddd1111dddd,,,,zzzzpppprrrroooodddd1111dddd((((3333FFFF))))                                        ccccpppprrrroooodddd1111dddd,,,,zzzzpppprrrroooodddd1111dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74. Example of Calling Sequence
  75.      Working on a sequence of 1024 complex values.  We successively apply a
  76.      Direct Fourier Transform, the product with a filter transform, then an
  77.      Inverse Fourier Transform-
  78.      Elements of each sequence are stored with increment (stride)1.
  79.      _F_o_r_t_r_a_n
  80.           complex array(0:1024-1), filter(0:1024-1),
  81.                   coeff(1024+15)
  82.           call cfft1di( 1024, coeff)
  83.           call cfft1d( -1, 1024, array, 1, coeff)
  84.           ccccaaaallllllll ccccpppprrrroooodddd1111dddd(((( 1111000022224444,,,, aaaarrrrrrrraaaayyyy,,,, 1111,,,, ffffiiiilllltttteeeerrrr,,,,
  85.           call cfft1d(  1, 1024, array, 1, coeff)
  86.  
  87.      _C
  88.           #include <fft.h>
  89.           complex array[1024], filter[1024], *coeff;
  90.           coeff = cfft1di( 1024, NULL);
  91.           cfft1d( -1, 1024, array, 1, coeff);
  92.           ccccpppprrrroooodddd1111dddd(((( 1111000022224444,,,, aaaarrrrrrrraaaayyyy,,,, 1111,,,, ffffiiiilllltttteeeerrrr,,,, 1111))));;;;
  93.           cfft1d( -1, 1024, array, 1, coeff);
  94.  
  95.      NNNNOOOOTTTTEEEE :::: As the FFTs are not normalized, a successive direct, then inverse
  96.      transform, scales the original input by the size of the sequence. Rather
  97.      than calling cscal1d or zscal1d to scale back the result, this scaling
  98.      factor could be directly applied to the filter transform, thus saving
  99.      some extra work.
  100.  
  101. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  102.      fft, cfft1di, zfft1di, cfft1d, zfft1d, cscal1d, zscal1d
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.